package com.yanyun.yczyy.api.controller;

import com.yanyun.yczyy.api.entities.*;
import com.yanyun.yczyy.api.repository.IDeviceManagerRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class DeviceManagerController {
    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/doorStatus")
    public DeviceDoorStatusView doorStatus() {
        return deviceManagerRepository.doorStatus();
    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/catchmentWallStatus")
    public List<DeviceCatchmentWallStatus> catchmentWallStatus() {
        return deviceManagerRepository.catchmentWallStatus();

    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/airConditioningStatus")
    public DeviceAirConditioningStatus airConditioningStatus() {
        return deviceManagerRepository.airConditioningStatus();

    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/areaAirConditioningStatus")
    public List<DeviceAreaAirConditioningStatus> areaAirConditioningStatus() {
        return deviceManagerRepository.areaAirConditioningStatus();

    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/departmentCTPStatus")
    public List<DeviceDepartmentCTPStatus> departmentCTPStatus() {
        return deviceManagerRepository.departmentCTPStatus();

    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/cameraStatus")
    public DeviceCameraStatus cameraStatus() {
        return deviceManagerRepository.cameraStatus();

    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/areaCameraStatus")
    public List<DeviceAreaCameraStatus> areaCameraStatus() {
        return deviceManagerRepository.areaCameraStatus();

    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/elevatorFloorStatus")
    public List<DeviceElevatorFloorStatus> elevatorFloorStatus() {
        return deviceManagerRepository.elevatorFloorStatus();

    }

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/device/elevatorRunningStatus")
    public List<DeviceElevatorRunningStatus> elevatorRunningStatus() {
        return deviceManagerRepository.elevatorRunningStatus();

    }

    @Autowired
    IDeviceManagerRepository deviceManagerRepository;
}
